package com.biscuit.page.basicservice.conf.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author mazihao
 * @createTime 2024/3/11 9:33
 */
@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redisson() {
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://120.46.171.159:6379")
                .setDatabase(0)
                .setPassword("Biscuit8888");
        config.setCodec(new JsonJacksonCodec());
        return Redisson.create(config);
    }

}